package cn.iocoder.yudao.module.system.dal.mysql.jd;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.module.system.controller.admin.dept.vo.jd.OrderPageReqVO;
import cn.iocoder.yudao.module.system.dal.dataobject.jd.OrderDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 订单 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface OrderMapper extends BaseMapperX<OrderDO> {

    default PageResult<OrderDO> selectPage(OrderPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<OrderDO>()
                .eqIfPresent(OrderDO::getOrderId, reqVO.getOrderId())
                .eqIfPresent(OrderDO::getShopId, reqVO.getShopId())
                .likeIfPresent(OrderDO::getProdName, reqVO.getProdName())
                .eqIfPresent(OrderDO::getUserId, reqVO.getUserId())
                .eqIfPresent(OrderDO::getOrderNumber, reqVO.getOrderNumber())
                .eqIfPresent(OrderDO::getStatus, reqVO.getStatus()));
    }
}